Apparatus, method and program product for controlling data writing of tape recording apparatus

ABSTRACT

In one embodiment, a write controlling method is provided that adjusts the timing to wrap-turn the tape running direction depending on the data amount in order to reduce the time required for positioning in reading any data by performing back-and-forth data writing by positioning a magnetic head of a tape recording apparatus at a predetermined position close to a first end of the tape medium, writing data on the tape medium starting from the predetermined position toward a second end of the tape medium, wrap-turning a running direction of the tape medium when the magnetic head reaches the second end of the tape medium, and writing the data on the tape medium from the second end toward the first end.

RELATED APPLICATIONS

The present application claims priority to Japanese Patent ApplicationNo. 2012-208724, filed Sep. 21, 2012, which is herein incorporated byreference.

BACKGROUND

The present invention relates to ape recording apparatus (a tape drive)that records data in a tape medium (a tape) by running the tape mediumback and forth in the longitudinal direction thereof.

In particular, it relates to a write controlling method that involvesadjusting, the timing of wrap-turning of the tape running directiondepending on the amount of data in order to reduce the time required forpositioning the tape in reading of any data.

Tape drives are superior to hard disk drives in energy consumptionefficiency, that is, as a green storage,

In addition, in terms of data reading/writing performance, tape drivesare comparable to hard disk drives.

However, tape drives are significantly inferior to hard disk drives incapability of positioning for data reading/writing.

According to a technique for a tape drive described in Japanese PatentNo. JP7009-099707A, after a chunk of data is written on a tape medium,the part of the tape medium from the end of the chunk of data up to aposition close to a predetermined position (LP3) at a first end of thetape medium is padded with dummy data before another chunk of data iswritten on the tape medium, thereby improving the positioningcapability.

The technique described in Japanese Patent No. JP2009-099207A iseffective for reducing the time required to move to the beginning of anydata when the tape medium is inserted into the tape drive. However, thetechnique is not effective for reducing the time required to move to thebeginning of any data after reading other data written on the tapemedium.

BRIEF SUMMARY

According to one embodiment, a data write controlling method is providedthat uses a tape storage apparatus that reduces the time required forpositioning a tape medium prior to reading any data from the tapemedium.

According this embodiment, the end of the data written on the tapemedium is adjusted to be close to a predetermined position on the tapemedium by changing the timing to wrap-turn the tape running direction.As a result, the capability of data positioning in reading the datawritten on the tape medium is dramatically improved.

In another embodiment, a method for controlling data writing using atape recording apparatus, wherein the tape recording apparatus includesa magnetic head and is configured to record data on a tape medium byrunning the tape medium back and forth in a longitudinal directionbetween opposite ends of the tape medium, includes performingback-and-forth data writing by positioning the magnetic head at apredetermined position close to a first end of the tape medium, writingthe data on the tape medium starting from the predetermined position,wrap-turning a running direction of the tape medium a first time whenthe magnetic head reaches a second end of the tape medium, and writingthe data on the tape medium from the second end toward the first end,wrap-turning the running direction of the tape medium a second time whenthe magnetic head reaches the first end after the first wrap-turn andperforming a subsequent back-and-forth data writing, and wrap-turningthe running direction of the tape medium a third time before themagnetic head reaches the second end and writing a first half of dataremaining to be written after the second wrap-turn when the dataremaining to be written in the subsequent back-and-forth data writing issmaller than a volume of the data to be written in one back-and-forthrunning of the tape medium so that an end of the data is written at aposition close to the first end, and writing a second half of dataremaining to be written after the second wrap-turn toward the first end.

In another embodiment, a tape recording apparatus configured to recorddata on a tape medium by running the tape medium back and forth in alongitudinal direction between opposite ends of the tape medium,includes a controller configured to perform back-and-forth data writingby positioning a magnetic head of the tape recording apparatus at apredetermined position close to a first end of the tape medium, writethe data on the tape medium starting from the predetermined position,wrap-turn a running direction of the tape medium a first time when themagnetic head reaches a second end of the tape medium, write the data onthe tape medium from the second end toward the first end, wrap-turn therunning direction of the tape medium a second time when the magnetichead reaches the first end after the first wrap-turn and performsubsequent back-and-forth data writing, and when an amount of dataremaining to be written in the subsequent back-and-forth data writing issmaller than a volume of the data to be written in one back-and-forthrunning of the tape medium, wrap-turn the running direction of the tapemedium a third time before the magnetic head reaches the second end whenthe first half of the amount of data remaining to be written after thesecond wrap-turn is written so that an end of the data is written at aposition close to the first end, and write a second half of the dataremaining to be written after the second wrap-turn toward the first end.

According to another embodiment, a program configured to control datawriting using a tape recording apparatus configured to record data on atape medium by running the tape medium back and forth in a longitudinaldirection between opposite ends of the tape medium causes a computerprocessor to perform back-and-forth data writing by positioning amagnetic head of the tape recording apparatus at a predeterminedposition close to a first end of the tape medium, write the data on thetape medium starting from the predetermined position, wrap-turn arunning direction of the tape medium a first time when the magnetic headreaches a second end of the tape medium, and write the data on the tapemedium from the second end toward the first end, wrap-turn the runningdirection of the tape medium a second time when the magnetic headreaches the first end after the first wrap-turn and perform subsequentback-and-forth data writing, and when an amount of data remaining to bewritten in the subsequent back-and-forth data writing is smaller than avolume of the data to be written in one back-and-forth running of thetape medium, wrap-turn the running direction of the tape medium a thirdtime before the magnetic head reaches the second end when a first halfof the amount of the data remaining after the second wrap-turn iswritten so that an end of the data is written at a position close to thefirst end, and write a second half of the data remaining to be writtenafter the second wrap-turn toward the first end.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIGS. 1( a)-1(c) show a data reading/writing format that involvesrepeatedly running a tape back and forth in the longitudinal direction,according to one embodiment.

FIG. 2 shows an example of a hardware configuration of a tape recordingapparatus according to one embodiment.

FIGS. 3( a)-3(b) are diagrams that illustrate methods of writing data intwo wraps of a tape medium by wrap-turning the tape running direction.

FIG. 4 shows flow of a writing method according to an embodiment.

FIG. 5 is a diagram illustrating a method for writing data sent from aplurality of hosts in such a manner that the data is easily accessed bya host.

DETAILED DESCRIPTION

The following description is made for the purpose of illustrating thegeneral principles of the present invention and is not meant to limitthe inventive concepts claimed herein. Further, particular featuresdescribed herein can be used in combination with other describedfeatures in each of the various possible combinations and permutations.

Unless otherwise specifically defined herein, all terms are to be giventheir broadest possible interpretation including meanings implied fromthe specification as well as meanings understood by those skilled in theart and/or as defined in dictionaries, treatises, etc.

It must also be noted that, as used in the specification and theappended claims, the singular forms “a,” “an” and “the” include pluralreferents unless otherwise specified.

The following description discloses several preferred embodiments ofmagnetic storage systems, as well as operation and/or component partsthereof.

In one general embodiment, a method for controlling data writing using atape recording apparatus, wherein the tape recording apparatus includesa magnetic head and is configured to record data on a tape medium byrunning the tape medium back and forth in a longitudinal directionbetween opposite ends of the tape medium, includes performingback-and-forth data writing by positioning the magnetic head at apredetermined position close to a first end of the tape medium, writingthe data on the tape medium starting from the predetermined position,wrap-turning a running direction of the tape medium a first time whenthe magnetic head reaches a second end of the tape medium, and writingthe data on the tape medium from the second end toward the first end,wrap-turning the running direction of the tape medium a second time whenthe magnetic head reaches the first end after the first wrap-turn andperforming a subsequent back-and-forth data writing, and wrap-turningthe running direction of the tape medium a third time before themagnetic head reaches the second end and writing a first half of dataremaining to be written after the second wrap-turn when the dataremaining to be written in the subsequent back-and-forth data writing issmaller than a volume of the data to be written in one back-and-forthrunning of the tape medium so that an end of the data is written at aposition close to the first end, and writing a second half of dataremaining to be written after the second wrap-turn toward the first end.

In another general embodiment, a tape recording apparatus configured torecord data on a tape medium by running the tape medium back and forthin a longitudinal direction between opposite ends of the tape medium,includes a controller configured to perform back-and-forth data writingby positioning a magnetic head of the tape recording apparatus at apredetermined position close to a first end of the tape medium, writethe data on the tape medium starting from the predetermined position,wrap-turn a running direction of the tape medium a first time when themagnetic head reaches a second end of the tape medium, write the data onthe tape medium from the second end toward the first end, wrap-turn therunning direction of the tape medium a second time when the magnetichead reaches the first end after the first wrap-turn and performsubsequent back-and-forth data writing, and when an amount of dataremaining to be written in the subsequent back-and-forth data writing issmaller than a volume of the data to be written in one back-and-forthrunning of the tape medium, wrap-turn the running direction of the tapemedium a third time before the magnetic head reaches the second end whenthe first half of the amount of data remaining to be written after thesecond wrap-turn is written so that an end of the data is written at aposition close to the first end, and write a second half of the dataremaining to be written after the second wrap-turn toward the first end.

According to another general embodiment, a program configured to controldata writing using a tape recording apparatus configured to record dataon a tape medium by running the tape medium back and forth in alongitudinal direction between opposite ends of the tape medium causes acomputer processor to perform back-and-forth data writing by positioninga magnetic head of the tape recording apparatus at a predeterminedposition close to a first end of the tape medium, write the data on thetape medium starting from the predetermined position, wrap-turn arunning direction of the tape medium a first time when the magnetic headreaches a second end of the tape medium, and write the data on the tapemedium from the second end toward the first end, wrap-turn the runningdirection of the tape medium a second time when the magnetic headreaches the first end after the first wrap-turn and perform subsequentback-and-forth data writing, and when an amount of data remaining to bewritten in the subsequent back-and-forth data writing is smaller than avolume of the data to be written in one back-and-forth running of thetape medium, wrap-turn the running direction of the tape medium a thirdtime before the magnetic head reaches the second end when a first halfof the amount of the data remaining after the second wrap-turn iswritten so that an end of the data is written at a position close to thefirst end, and write a second half of the data remaining to be writtenafter the second wrap-turn toward the first end.

In order to reduce the time required for positioning a tape medium forreading any data from the tape medium, one embodiment provides a methodfor controlling data writing by a tape recording apparatus that recordsdata on a tape medium by running the tape medium back and forth in alongitudinal direction between opposite ends of the tape medium. Themethod comprises performing back-and-forth data writing by positioning amagnetic head of the tape recording apparatus at a predeterminedposition close to a first end of the tape medium, writing the data onthe tape medium starting from the predetermined position toward a secondend of the tape medium, wrap-turning a running direction of the tapemedium a first time when the magnetic head reaches a second end of thetape medium, and writing the data on the tape medium from the second endtoward the first end, wherein the running direction of the tape mediumis wrap-turned again when the magnetic head reaches the first end afterthe first wrap-turn and performing a subsequent back-and-forth datawriting, and when the amount of remaining data to be written in thesubsequent back-and-forth data writing is smaller than a volume of thedata to be written in one back-and-forth running of the tape medium (thevolume of the data to be written in the wraps involved in theback-and-forth writing; that is, the end of the data (EOD) does notreach the first end after wrap-turn), dynamically wrap-turning therunning direction of the tape medium before the magnetic head reachesthe second end when the first half of the amount of the remaining dataafter the wrap-turn is written so that the EOD is written at a positionclose to the first end, and writing the second half of the remainingdata toward the first end.

The controlling method, in one embodiment, may further comprisereceiving a value of the volume of all the data to be written from ahost apparatus, and calculating the amount of data to be written on thetape medium that remains from the value of the volume of all of the datato be written.

The controlling method, in another embodiment, may further comprisereceiving the value of the volume of all of the data using the taperecording apparatus by receiving a special command from the hostapparatus along with the data.

The controlling method according to another embodiment may comprisecalculating the amount of the remaining data from the value of thevolume of all of the data using an application in a host apparatus, andreceiving a special command from the host apparatus that indicates atiming to dynamically perform the wrap-turn (a position at which thedynamic wrap-turn occurs) using the tape recording apparatus.

The controlling method in yet another embodiment may comprise startingthe back-and-forth running of the data writing at a predeterminedposition (LP3) following servo data adjacent to the first end (LP2).

The controlling method, according to another embodiment, may comprisecalculating the amount of the remaining data from the value of thevolume of all of the data each time the back-and-forth writing iscompleted.

In another embodiment, the controlling method may comprise calculatingthe amount of the remaining data when the value of the volume of all ofthe data is received.

According to yet another embodiment, the controlling method may comprisecalculating the amount of the remaining data by taking intoconsideration an allowance margin (a loss capacity) that may occur dueto a write error correction.

Moreover, the controlling method in one approach may include writing thesecond half of the remaining data after the dynamic wrap-turn, if theEOD being written does not reach the first end, dummy data is written upto a position close to the first end.

Additionally, the controlling method is characterized in that the tapemedium has a plurality of bands extending in the longitudinal directionof the tape medium, each of the bands has a plurality of wraps (tracks)extending in the longitudinal direction, and the back-and-forth datawriting is performed on pairs of the wraps (tracks).

Furthermore, in another embodiment, a tape recording apparatus comprisesa magnetic head and is configured to record data on a tape medium byrunning the tape medium back and forth in a longitudinal directionbetween opposite ends of the tape medium, and a controller of theapparatus is configured to perform back-and-forth data writing bypositioning the magnetic head of the tape recording apparatus at apredetermined position close to a first end of the tape medium, writingthe data on the tape medium starting from the predetermined positiontoward a second end of the tape medium, wrap-turning a running directionof the tape medium when the magnetic head reaches the second end of thetape medium, and continuing to write the data on the tape medium fromthe second end toward the first end. The controller ay further beconfigured to wrap-turn the running direction of the tape medium whenthe magnetic head reaches the first end after the first wrap-turn andperform subsequent back-and-forth data writing, and when the amount ofthe remaining data to be written in the subsequent back-and-forth datawriting is smaller than a volume of the data to be written in oneback-and-forth running of the tape medium (the volume of the data to bewritten in the tracks involved in the back-and-forth writing, that is,the EOD does not reach the first end after wrap-turn), wrap-turn therunning direction of the tape medium before the magnetic head reachesthe second end when the first half of the amount of the remaining dataafter the second wrap-turn is written so that the EOD is written at aposition close to the first end, and write the second half of theremaining data toward the first end.

Furthermore, in another approach, a program that controls data writingusing a tape recording apparatus that records data on a tape medium isconfigured to run the tape medium back and forth in a longitudinaldirection between opposite ends of the tape medium. The program isconfigured to cause a computer processor to perform back-and-forth datawriting by positioning a magnetic head of the tape recording apparatusat a predetermined position close to a first end of the ape medium,write the data on the tape medium starting from the predeterminedposition toward a second end of the tape medium, wrap-turn a runningdirection of the tape medium when the magnetic head reaches the secondend of the tape medium, and write the data on the tape medium from thesecond end toward the first end, wrap-turn the running direction of thetape medium when the magnetic head reaches the first end after the firstwrap-turn and perform a subsequent back-and-forth data writing, and whenthe amount of the remaining data to be written in the subsequentback-and-forth data writing is smaller than a volume of the data to bewritten in one back-and-forth running of the tape medium (the volume ofthe data to be written in the tracks involves in the back-and-forthwriting, that is, the EOD does not reach the first end after wrap-turn),wrap-turn the running direction of the tape medium before the magnetichead reaches the second end when the first half of the amount of theremaining data after the second wrap-turn is written so that the EOD islocated at a position close to the first end, and write the second halfof the remaining data toward the first end.

In the following, modes for carrying out specific embodiments aredescribed. However, the embodiments are not intended to limit thepresent invention which is only defined by the claims.

In particular, a writing method in one embodiment writes a relativelylarge amount of data (a motion picture file, for example) on a tapemedium a tape drive so as to reduce the time required for positioningthe tape drive in data reading. The writing method according to thisembodiment is described in a context where a host apparatus (a host)sends data to a tape recording apparatus (a tape drive). The timing ofwrap-turning of the direction of running of the tape medium isdynamically determined during data writing in order to position thetrailing end of write data, that is, the EOD of write data, at apredetermined position on the tape medium (the tape).

FIGS. 1( a)-(c) show a data reading/writing format that involvesrepeatedly running a tape back and forth in the longitudinal direction.When sequentially writing data on a tape medium, the tape drive startswriting the data from the beginning of the tape.

An LTO (Linear Tape Open) or IBM TS1120 tape drive uses the datareading/writing format that involves repeatedly running a tape back andforth in the longitudinal direction.

According to the existing format, the direction of running of the tapeis always changed or wrap-turned at a predetermined position, such aseither of the longitudinal ends thereof or a position close thereto (LP3or LP4).

In the following, embodiments are described in the context of a taperecording apparatus complying with the LTO standard as an example.However, the application of the present invention is not limited to atape recording apparatus complying with the LTO standard or a hostapparatus connected to the tape recording apparatus. Embodiments may beeffectively applied to any tape recording apparatus that records data ona tape medium by running the tape medium back and forth in thelongitudinal direction.

Referring to FIG. 1( a), a configuration of a recording region of a tapemedium complying with the LTO standard and a data writing method isdescribed. As shown, a tape medium 10 has a plurality of bands 15extending in the longitudinal direction of the tape medium 10 from thebeginning of the tape (BOT) to the end of the tape (EOT). A servo track20 for controlling the data write position extends in the longitudinaldirection along each side of each of the plurality of bands 15.

FIG. 1( b) shows that the tape drive does not start writing data from alogical position 2 (LP2) at the beginning of the tape medium 10 (BOT)but from a position slightly behind LP2, which is shown as LP3. Whensequentially writing data on the tape medium 10 having such a recordingregion configuration, the tape recording apparatus complying with theLTO standard starts writing data from the beginning of the tape medium10.

When writing data on the tape medium 10 for the first time, the taperecording apparatus starts writing data from a position close to LP3 ona data band 0, which is denoted by reference numeral 40 in FIG. 1( b)and continues writing data toward LP4. Once data is written to the endof the tape medium 10, the tape recording apparatus wrap-turns the taperunning direction so that the tape runs in the direction from LP4 to LP3as shown by an arrow in FIG. 1( b), and continues writing data. Ifadditional data is to be written, the tape recording apparatus startswriting the additional data from a position adjacent to the last writtendata (the last data having already been written) on the tape medium 10.

The various tape positions described above may be stored in anonvolatile memory, such as a cartridge memory (CM), equipped in thetape apparatus. Each region in which data is written in the directionfrom LP3 to LP4 or the direction from LP4 to LP3 is referred to as awrap. The plurality of wraps are identified by identification numbers.The wrap may be referred to also as a data track (or a track). Theoperation of changing (such as reversing) the tape running direction isreferred to as wrap-turn or wrap-turning. When writing data on the tapemedium, the tape drive reconstructs data having a variable length sentfrom a host into a unit having a fixed length referred to as a data set(DS). Each DS includes meta-data or meta information about the DS, suchas a data set information table (DSIT).

When writing data on the tape medium for the first time, the tape drivestarts writing the data from a position close to LP3 in a wrap numbered“0” (Wrap#0). When writing additional data, the tape drive startswriting the additional data from a position adjacent to the last writtendata. When overwriting existing data with the additional data, the tapedrive starts writing the additional data from the beginning of data tobe overwritten. The tape drive is a sequential access device andtherefore cannot place data at an arbitrary position to improve theaccess speed.

In accessing data other than the first written data, the beginning ofthe data is located at an arbitrary position. In other words, thebeginning of the data is not always located at a position close to LP3.Therefore, tape positioning takes a long time conventionally. Accordingto the LTO standard, it takes about two minutes to move the magnetichead from a current position LP3 to a position close to LP4.

The tape recording apparatus, which is a sequential access device,sequentially records data on the tape medium 10 by running the tapemedium 10 back and forth in the longitudinal direction. Accordingly,data other than the first written data begins at an arbitrary positionon the tape medium 10. Therefore, in reading data or in writing newdata, the data to be read or the new data to be written may not begin atthe beginning of the tape medium 10. If the data to be read or the newdata to be written does not begin at the beginning of the ape medium 10,the tape medium 10 needs to be run to a desired position, and thus, tapepositioning takes a long time.

FIG. 1( c) shows a wrap structure or track structure of one data bandaccessed by a magnetic head having a one reading/writing channel. Onedata band includes eleven wraps or tracks. The one magnetic headaccesses the eleven tracks by changing the tape direction. First, themagnetic head accesses the outermost physical track as shown by an arrowin the drawing. When the magnetic head reaches the end of the track,that is, the end of the tape, the magnetic head changes the tapedirection and accesses a track on the other side as shown by an arrow.In this way, each time the magnetic head reaches the end of the tape,the magnetic head changes direction and accesses an inner track in theopposite direction.

The track number (track#) is an identification number that depends onthe physical position on the tape medium, and the wrap number (Wrap#) isan identification number assigned to the physical position on the tapemedium in the order of access.

If Wrap# is an even number, reading/writing occurs in the direction fromLP3 to LP4. If Wrap# is an odd number, reading/writing occurs in thedirection from LP4 to LP3. In the writing method according to oneembodiment described below, a chunk of data read/written in oneback-and-forth writing is expressed by a pair of wraps numbered by aneven number and an odd number, such as Wrap#0 and Wrap#1. Specifically,a chunk of data read/written in one back-and-forth writing is expressedas a pair of wraps numbered 2*N and 2*(N+1), for example. A DS, which isa unit of reading/writing, is stored. Note that the symbol “*”represents multiplication.

FIG. 2 shows an example of a hardware configuration of a tape storageapparatus 100 to which an embodiment is applied. The tape storageapparatus 100 includes an interface 110, a buffer 120, a recordingchannel 130, a read/write head 140, a controller 150, a positioning part160, a motor driver 170 and a motor 180.

The communication interface 110 communicates with a host apparatus 300over a network. For example, the interface 110 receives a write commandto write data on the tape medium 10 from the host apparatus 300. Theinterface 110 also receives a read command to read data from the tapemedium 10 from the host apparatus 300.

The buffer 120 is a memory that temporarily stores data to be written onthe tape medium 10 or data read from the tape medium. For example, thebuffer 120 may be a dynamic random access memory (DRAM). The recordingchannel 130 is a communication channel used to write data stored in thebuffer 120 on the tape medium 10 or to temporarily store data read fromthe tape medium 10 in the buffer 120.

The read/write head 140 has a data read/write element, and writes dataon the tape medium 10 and reads data from the tape medium 10. Theread/write head 140 according to this embodiment has a servo readelement and reads a signal from a servo track provided in the tapemedium 10. The positioning part 160 issues an instruction to move theread/write head 140 in the lateral (width) direction of the tape medium10. The motor driver 170 drives the motor 180.

The controller 150 controls the whole of the tape recording apparatus100. More specifically, the controller 150 controls writing of data onthe tape medium 10 and reading of data from the tape medium 10 accordingto a command received by the interface. Furthermore, the controller 150controls the positioning part 160 according to a signal read from theservo track. Furthermore, the controller 150 controls the operation ofthe motor via the positioning part 160 and the motor driver 170. Themotor driver 170 may be directly connected to the controller 150. Therecording channel 130, the read/write head 140, the positioning part160, the motor driver 170 and the motor 180 will be collectivelyreferred to as a tape drive 190.

In addition to serving the functions described above, the controller 150according to this embodiment controls the tape running direction todynamically wrap-turn during data writing in such a manner as to ensurethat the EOD being written on the tape medium 10 is located at aposition close to the beginning of the tape medium 10. This functionwill be described in detail later with reference to drawings. Thecontroller 150 may be implemented by a CPU, a RAM and/or a ROM, notshown. The ROM stores programs for making the controller 150 serve theabove-described functions after activation, including a boot programexecuted by the CPU to activate the tape recording apparatus 100 or acontrol program according to this embodiment. The CPU executes theseprograms using the RAM.

Next, an example of a functional configuration of the controller 150 ofthe tape recording apparatus 100 according to one embodiment will bedescribed.

The controller 150 according to this embodiment determines the timing ofdynamically wrap-turning the running direction of the tape medium 10.The position in the wrap or track at which wrap-turn occurs isdetermined in such a manner as to ensure that the EOD being written onthe tape medium 10 is located at a position close to the beginning (LP3)of the tape medium 10.

The controller 150 acquires the volume of data sent to the taperecording apparatus 100 (tape drive). Specifically, the volume of datamay be acquired by receiving a special command from the host. Anapplication in the host sends a series of a plurality of records, andthe tape drive writes, on the tape medium, a plurality of records as onepiece of data in units of DS. Since the host has acquired the volume ofall of the data, the host may issue the special command to inform thetape drive of the volume of all of the data at a predetermined timing inthe course of sending the plurality of records to the tape drive.

For example, when the host apparatus 300 and the tape recordingapparatus 100 communicate with each other in accordance with the SCSIprotocol, the special command may be provided by using a region referredto as Vendor Specific. For a Write command, bits 7 and 6 of byte 5 maybe prepared as the Vendor Specific region. Alternatively, a new ID maybe provided for a Send Diagnostic command, and the command may be usedas the specific command. Alternatively, the special command may beprovided as an entirely new command. The special command may be providedin any way.

In the tape recording apparatus 100 having received the special command,the controller 150 performs each required processing to bring thebeginning of the data to be written to the beginning of the tape medium10.

The controller 150 marks the data so as to make it obvious when the datais to be read that the data has been dynamically wrap-turned at apredetermined position in the wrap. The DS described above has tworegions: a data region and a DSIT region. The data region is literally aregion in which data is recorded, and the DSIT region is a region inwhich the content of the data region is described.

The controller 150 may use bit 1 of data set flags included in the DSIT.If the bit 1 of the data set flags is set, the tape recording apparatus100 understands that the DS has been written by wrap-turning the runningdirection of the tape medium in a wrap of the last back-and-forth datawriting. Therefore, by keeping the bit 1 set, the controller 150 may usethe DS written last on the tape medium 10 as data written by dynamicallywrap-turning the tape running direction in the last back-and-forthwriting. Since the bit 1 is set, the data written by dynamicallywrap-turning the tape running direction has to be read by wrap-turningthe tape running direction at a predetermined timing.

To determine the timing to wrap-turn in the course of the lastback-and-forth writing, the size of the data to be written in the lastback-and-forth writing (the amount of the remaining data) is calculatedfrom the volume of the whole data. The size of the remaining data issmaller than the amount of data written in one back-and-forth writing.

FIGS. 3( a)-3(b) illustrate ways of writing data in two wraps of thetape medium by wrap-turning the tape running direction. The“back-and-forth writing” is defined as an operation of writing data intwo wraps assigned with successive odd and even numbers by wrap-turningthe running direction of the tape medium. FIGS. 3( a)-3(b) show twocases that differ in the amount of the remaining data (2*Z) to bewritten in the last back-and-forth writing after a plurality ofback-and-forth writings.

FIG. 3( a) shows a case where the amount of the remaining data (2*Z) issmaller than the capacity Y of a wrap, that is, 2*Z<Y. FIG. 3( b) showsa case where the amount of the remaining data “2*Z” is equal to orgreater than the capacity Y of a wrap and smaller than the amount ofdata written in one back-and-forth writing (2*Y), that is, Y≦2*Z<2Y.

For both FIGS. 3( a) and 3(b), the upper half shows a conventionalwrap-turn during writing, and the lower half shows a wrap-turn duringwriting according to one embodiment.

In both lower halves of FIGS. 3( a) and 3(b), if the amount of theremaining data (2*Z) is smaller than the amount of data to be written inone back-and-forth data writing (2*Y), the running direction of the tapemedium is wrap-turned at a position in the wrap corresponding to a halfof the amount of the remaining data, so that the end of the data beingwritten (EOD) is located at a specified position (LP3) close to a firstend.

It is supposed that the volume of the data to be written is denoted byX, and the recording capacity of a wrap is denoted by Y. The volume ofdata to be written in one back-and-forth data writing is 2*Y. The volumeX of the data to be written satisfies a relation Y*(2*N)<X≦Y*(2*(N+1)),and the number of times N of the back-and-forth writings is alwaysuniquely determined according to this relation.

The “volume X of the data to be written” does not refer to the volume ofa record exchanged between the tape drive and the host through one writecommand (Write), that is, the volume of a fragment of File A. “Data(file)” refers to relatively large data, such as a video file. Morespecifically, write data (a write file) in one embodiment is a set ofrecords of a video. The host sends each record to the tape drive in sucha manner that it may be discriminated from the others by a command.Therefore, the host calculates the volume X of the data of File A, whichis a set of records.

In order to bring the EOD to LP3, the data may be normally written inthe first 2*N wraps in the region between LP3 and LP4. Then, in thecourse of writing the data in the (2*N+1)-th wrap, the tape runningdirection may be wrap-turned when an amount Z of data expressed by thefollowing formula is written (that is, before reaching LP4).Z=(Y−D)*(1+E)/2

In the formula, D represents the volume of data written in the first 2*Nwraps, and E represents a decrease in recording capacity due to errorcorrection in writing. For example, if a tape medium having a capacityof 1.03 GB is needed to write 1 GB of data, the value of E is 0.03.Depending on the format, the tape medium typically has a margin of about3%, and even if about 3% of the capacity of the tape medium is used forerror correction in writing, a specified volume of data for the tapemedium may be written on the tape medium. If the error occurrencefrequency in writing is low, and LP3 is not reached when the data iscompletely written, the remaining region up to LP3 may be padded withdummy data.

FIG. 3( a) shows a case where the amount 2*Z of the remaining data ofFile A after the back-and-forth writing in the wraps numbered 2*N−1 and2*N+1 is smaller than the capacity Y a wrap (2*Z<Y).

The upper half shows a conventional writing method, in which all of theamount 2*Z of the remaining data is written in the wrap numbered 2*N+1,and the EOD does not reach a second end (LP4) of the tape medium.

The lower half shows the writing method according to one embodiment, inwhich when the first half Z of the amount of the remaining data iswritten in the wrap numbered 2*N+1, the running direction of the tapemedium is wrap-turned. Then, the second half Z of the amount of theremaining data is written in the wrap numbered 2*N+2, so that the EOD islocated at the first end (LP3).

FIG. 3( b) shows a case where the amount 2*Z of the remaining data ofFile A after the back-and-forth writing in the wraps numbered 2*N−1 and2*N+1 is equal to or greater than the capacity Y of a wrap and smallerthan the capacity 2*Y of the wraps involved in one back-and-forthwriting (Y≦2*Z<2Y).

The upper half shows a conventional writing method, in which all of theamount of the remaining data is written in the wraps numbered 2*N+1 and2*N+2. The EOD does not reach the first end (LP3) of the tape medium.

The lower half shows the writing method according to one embodiment, inwhich when the first half of the amount of the remaining data is writtenin the wrap numbered 2*N+1, the running direction of the tape medium isdynamically wrap-turned. Then, the second half of the amount 2*Z of theremaining data is written in the wrap numbered 2*N+2, so that the EOD islocated at a predetermined position (LP3) close to the first end.

As can be seen from the lower halves of FIGS. 3( a) and 3(b), accordingto one embodiment, the position at which data writing starts and theposition of the end of the data written (EOD) are a predeterminedposition (LP3) on the tape medium close to the first end thereof. Thepositions have different wrap identification numbers but coincide in thelongitudinal direction. In the case of sequential reading of relativelylarge data (a video file, for example) written on the tape medium, thepositioning time (seek time) required to move to the beginning of thenext piece of data after reading of a piece data may be reduced in mostcases.

According to one embodiment, since the tape running direction iswrap-turned at an arbitrary position not reaching LP4, a mechanism isused to record, in the tape medium, information that allows the tapedrive to detect that the tape running direction has been wrap-turned atthat position when reading the data from the tape medium. This may beachieved by recording, in the CM, information about the position ofwrap-turn in each wrap when the data is written. Alternatively, the DSITof the last DS written in each wrap may include a flag that indicatesthat the DS is the last DS in the wrap, the flag may be set at anappropriate value when the data is written, and the value of the flagmay be referred to, when the data is read, to determine whether the DSis the last DS in the wrap or not.

FIG. 4 shows a flow the writing method according to an embodiment. Theflow of steps 500, 510 and 520, in which the running direction of thetape medium is dynamically wrap-turned, is particularly interesting. Thewrap-turn occurs when a half of the amount 2*Z of the remaining dataafter several back-and-forth data writings (in step 490) is written. Theend of the data written (EOD) in the 2*(N+1)-th wrap is located at aposition close to LP3. The order of the steps shown in the figure isjust an example, and the ordering of the steps is not so limited.

In step 400, the tape drive receives a data write request from the host.The host sends a write command to write a plurality of records andrequests the tape drive to manage and record the plurality of records asone piece of data (file).

In step 410, the tape drive acquires the value of the volume X of all ofthe data from the host. The tape drive may acquire the value of thevolume X of all of the data by receiving a special command issued by thehost. Since an application in the host manages the plurality of records,the host may compile the records and calculate the value of the volume Xof all of the data from the records to be sent as a file. As analternative to the method in which the tape drive acquires the value ofthe volume X of the data from the host, the host may calculate thetiming of wrap-turn from the value of the volume X of all of the dataand inform the tape drive of the timing of wrap-turn in the course ofwriting the records by issuing the special command.

In step 420, the tape drive determines the number of times N of theback-and-forth writings from the value of the volume X of all of thedata. Provided that the capacity of a wrap is Y, the volume of the datawritten in one back-and-forth writing is 2*Y. Alternatively, the hostmay calculate these values. The tape drive may perform N back-and-forthwritings of the data sent from the host, N being determined by X and Y.

In step 430, the tape drive determines the amount (2*Z) of the remainingdata to be written in the 2*(N+1)-th wrap after the data is written inthe 2*N-th wrap by back-and-forth writing. Alternatively, the host maycalculate the data amount.

In step 440, the tape drive writes a plurality of records having avariable length on the tape medium in units of DS having a fixed length.The tape drive starts writing data on the tape medium in the directionfrom LP3 toward LP4. Then, when LP4 on the tape medium is reached (instep 470), the tape running direction is wrap-turned (in step 520), andthen, the data is written in the direction toward LP3. When LP3 on thetape medium is reached (in step 480), writing of the data in the wrapsduring the back-and-forth writing is completed (in step 490).

In step 450, if the EOD is reached when the data is written on aspecific wrap (Yes), writing of the data is completed (in step 460). Ifwriting of a DS including a subsequent record is not completed (No),writing of the data continues.

In step 470, if writing of the data continues, and the second end (LP4)of the tape medium is reached, the tape running direction is wrap-turned(in step 520).

In step 480, if writing of the data continues, and the first end (LP3)of the tape medium is reached, the current back-and-forth writing iscompleted (in step 490). The tape running direction is wrap-turned again(in step 520).

In step 490, in the case of a relatively large video file or the like,an amount 2*Z of remaining data after a plurality (N) of back-and-forthwritings, is written in the last pair of wraps 2*N+1 and 2*(N+1).

In step 500, the tape drive checks whether a half of the amount (2*N) ofthe remaining data is written in the (2*N+1)-th wrap, in order to ensurethe timing to wrap-turn the tape running direction. If a half (Z) of theamount (2*Z) of the remaining data is written in the (2*N+1)-th wrap ofthe tape (Yes), the tape running direction is wrap-turned even if LP4has not been reached yet (in step 520).

In step 510, the tape drive logs in the CM or DSIT that a wrap-turn hasoccurred in the (2*N+1)-th wrap (in step 510). When the log is to besaved in the DSIT, for example, the log may be saved by providing a newflag that indicates that the DS immediately before the wrap-turn is thelast DS in the (2*N+1)-th wrap. When the log is to be saved in the CM, acombination of the wrap and the ngitudinal position (LPOS) on the tapemay be logged. Alternatively, the wrap-turn of the tape runningdirection may be indicated by a data set number (DS#) or a record number(record#) included in the DS associated with the wrap number 2*(N+1).

In step 520, when the tape running direction is wrap-turned, the secondhalf Z of the remaining data (2*Z) is written in the wrap numbered2*(N+1). The position of the EOD is located at the predeterminedposition (LP3) in the wrap numbered 2*(N+1) close to the first end.

FIG. 5 is a diagram illustrating a method of writing data sent from aplurality of hosts in such a manner that the data may be easily accessedon a host basis.

According to one embodiment, the data sent from the plurality of hostsmay be gathered in their respective specified regions arranged along thelength of the tape in order to allow the data to be managed on a hostbasis. Alternatively, a file for each host may be written bywrap-turning the tape running direction before reaching LP4 or 123. Morespecifically, in a case of writing videos x−*(*=1, 2, 3, . . . ) sentfrom hosts x (x=1, 2, 3, . . . ) as shown in FIG. 5, the positions atwhich wrap-turn occurs may be dynamically determined so that wrap-turnsoccur at different positions in different wraps.

In FIG. 5, the left end of a video 1-1 is located at 123, and LP4 islocated several tens of meters t the right of the right end of a video3-3, for example. According to a conventional writing method, in orderto bring the end of a large file of a series of videos sent from a hostthat requires a plurality of wraps to 124, the series of videos iswrap-turned at an arbitrary position. According to one embodiment, asshown in FIG. 5, videos 1-4 to 1-6 are regarded as one virtual file. Andeven if the right end of the video 3-3 does not reach LP4, the taperunning direction is wrap-turned to bring the end of the virtual file(EOD) to LP3.

According to this embodiments described above, after data written on thetape medium is read, the time (seek time) required for positioning atthe beginning of the next data may be reduced.

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as “logic,” “circuit,” “module” or“system.” For example, one approach may include a processor and logicintegrated with and/or executable by the processor, the logic beingconfigured to perform various operations. Furthermore, aspects of thepresent invention may take the form of a computer program productembodied in one or more computer readable medium(s) having computerreadable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: a portable computerdiskette, a hard disk, a random access memory (RAM), a read-only memory(ROM), an erasable programmable read-only memory (EPROM or Flashmemory), a portable compact disc read-only memory (CD-ROM), an opticalstorage device, a magnetic storage device, or any suitable combinationof the foregoing. In the context of this document, a computer readablestorage medium may be any tangible medium that can contain or store aprogram for use by or in connection with an instruction executionsystem, apparatus, processor, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband, as part of a carrier wave, an electrical connection having oneor more wires, an optical fiber, etc. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other program able data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagram and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

Although the present invention has been described with reference toembodiments thereof, the scope of the present invention is not limitedto the embodiments described above. It would be obvious to those skilledin the art that various modifications may be made and variousalternatives may be adopted without departing from the spirit and scopeof the present invention.

What is claimed is:
 1. A method for controlling data writing using atape recording apparatus, wherein the tape recording apparatus comprisesa magnetic head and is configured to record data on a tape medium byrunning the tape medium back and forth in a longitudinal directionbetween opposite ends of the tape medium, the method comprising:performing back-and-forth data writing by positioning the magnetic headat a predetermined position close to a first end of the tape medium;writing the data on the tape medium starting from the predeterminedposition, wrap-turning a running direction of the tape medium a firsttime when the magnetic head reaches a second end of the tape medium, andwriting the data on the tape medium from the second end toward the firstend; wrap-turning the running direction of the tape medium a second timewhen the magnetic head reaches the first end after the first wrap-turnand performing a subsequent back-and-forth data writing; andwrap-turning the running direction of the tape medium a third timebefore the magnetic head reaches the second end and writing a first halfof data remaining to be written after the second wrap-turn when the dataremaining to be written in the subsequent back-and-forth data writing issmaller than a volume of the data to be written in one back-and-forthrunning of the tape medium so that an end of the data is written at aposition close to the first end, and writing a second half of dataremaining to be written after the second wrap-turn toward the first end.2. The method according to claim 1, further comprising: receiving avalue of a volume of all of the data from a host apparatus; andcalculating an amount of data remaining to be written on the tape mediumfrom the value of the volume of all of the data.
 3. The method accordingto claim 2, wherein the calculating the amount of data remaining to bewritten comprises calculating from the value of the volume of all of thedata each time the back-and-forth writing is completed.
 4. The methodaccording to claim 2, further comprising: receiving, using the taperecording apparatus, the value of the volume of all of the data byreceiving a special command from the host apparatus along with the data.5. The method according to claim 4, wherein the calculating the amountof data remaining to be written comprises calculating when the value ofthe volume of all of the data is received.
 6. The method according toclaim 2, wherein the amount of data remaining to be written iscalculated by taking into consideration an allowance margin for apossibility of occurrence of a write error correction.
 7. The methodaccording to claim 2, wherein a host apparatus calculates the amount ofdata remaining to be written from the value of the volume of all of thedata, and wherein the tape recording apparatus receives a specialcommand from the host apparatus that indicates a timing to dynamicallyperform wrap-turns.
 8. The method according to claim 1, wherein aposition at which data writing by the back-and-forth running starts is apredetermined position that follows servo data adjacent to the firstend.
 9. The method according to claim 1, wherein the writing the secondhalf of the data remaining to be written after the wrap-turn compriseswriting dummy data up to a position close to the first end when an endof the data being written does not reach the first end.
 10. The methodaccording to claim 1, wherein the tape medium has a plurality of bandsextending in a longitudinal direction of the tape medium, each of thebands having a plurality of wraps extending in the longitudinaldirection, and wherein the back-and-forth data writing is performed onpairs of the wraps.
 11. A tape recording apparatus configured to recorddata on a tape medium by running the tape medium back and forth in alongitudinal direction between opposite ends of the tape medium, thetape recording apparatus comprising a controller configured to: performback-and-forth data writing by positioning a magnetic head of the taperecording apparatus at a predetermined position close to a first end ofthe tape medium; write the data on the tape medium starting from thepredetermined position; wrap-turn a running direction of the tape mediuma first time when the magnetic head reaches a second end of the tapemedium; write the data on the tape medium from the second end toward thefirst end; wrap-turn the running direction of the tape medium a secondtime when the magnetic head reaches the first end after the firstwrap-turn and perform subsequent back-and-forth data writing; and whenan amount of data remaining to be written in the subsequentback-and-forth data writing is smaller than a volume of the data to bewritten in one back-and-forth running of the tape medium, wrap-turn therunning direction of the tape medium a third time before the magnetichead reaches the second end when the first half of the amount of dataremaining to be written after the second wrap-turn is written so that anend of the data is written at a position close to the first end, andwrite a second half of the data remaining to be written after the secondwrap-turn toward the first end.
 12. The tape recording apparatusaccording to claim 11, wherein the controller is further configured to:receive a value of a volume of all of the data from a host apparatus byreceiving a special command from the host apparatus along with the data;and calculate an amount of data remaining to be written on the tapemedium from the value of the volume of all of the data by at least oneof: calculating that the back-and-forth writing is completed from thevalue of the volume of all of the data each time; calculating when thevalue of the volume of all of the data is received.
 13. The taperecording apparatus according to claim 12, wherein the amount of dataremaining to be written is calculated by taking into consideration anallowance margin for a possibility of occurrence of a write errorcorrection.
 14. The tape recording apparatus according to claim 12,wherein a host apparatus calculates the amount of data remaining to bewritten from the value of the volume of all of the data, and wherein thetape recording apparatus receives a special command from the hostapparatus that indicates a timing to dynamically perform wrap-turns. 15.The tape recording apparatus according to claim 11, wherein a positionat which data writing by the back-and-forth running starts is apredetermined position that follows servo data adjacent to the firstend, wherein the writing the second half of the data remaining to bewritten after the wrap-turn comprises writing dummy data up to aposition close to the first end when an end of the data being writtendoes not reach the first end, and wherein the tape medium has aplurality of bands extending in a longitudinal direction of the tapemedium, each of the bands having a plurality of wraps extending in thelongitudinal direction, and wherein the back-and-forth data writing isperformed on pairs of the wraps.
 16. A computer program productconfigured to control data writing using a tape recording apparatus, thecomputer program product comprising a computer readable storage mediumhaving program code embodied therewith, the program code readable and/orexecutable by a processor to cause the processor to: performback-and-forth data writing by positioning a magnetic head of the taperecording apparatus at a predetermined position close to a first end ofa ape medium, write data on the tape medium starting from thepredetermined position, wrap-turn a running direction of the tape mediuma first time when the magnetic head reaches a second end of the tapemedium, and write the data on the tape medium from the second end towardthe first end; wrap-turn the running direction of the tape medium asecond time when the magnetic head reaches the first end after the firstwrap-turn and perform subsequent back-and-forth data writing; and whenan amount of data remaining to be written in the subsequentback-and-forth data writing is smaller than a volume of the data to bewritten in one back-and-forth running of the tape medium, wrap-turn therunning direction of the tape medium a third time before the magnetichead reaches the second end when a first half of the amount of the dataremaining after the second wrap/turn is written so that an end of thedata is written at a position close to the first end, and write a secondhalf of the data remaining to be written after the second wrap-turntoward the first end.
 17. The computer program product according toclaim 16, wherein the program code is further readable and/or executableby the processor to cause the processor to: receive a value of a volumeof all of the data from a host apparatus by receiving a special commandfrom the host apparatus along with the data; and calculate an amount ofdata remaining to be written on the tape medium from the value of thevolume of all of the data by at least one of: calculating that theback-and-forth writing is completed from the value of the volume of allof the data each time; and calculating when the value of the volume ofall of the data is received.
 18. The computer program product accordingto claim 17, wherein the amount of data remaining to be written iscalculated by taking into consideration an allowance margin for apossibility of occurrence of a write error correction.
 19. The computerprogram product according to claim 17, wherein a host apparatuscalculates the amount of data remaining to be written from the value ofthe volume of all of the data, and wherein the tape recording apparatusreceives a special command from the host apparatus that indicates atiming to dynamically perform wrap-turns.
 20. The computer programproduct according to claim 17, wherein a position at which data writingby the back-and-forth running starts is a predetermined position thatfollows servo data adjacent to the first end, wherein the writing thesecond half of the data remaining to be written after the wrap-turncomprises writing dummy data up to a position close to the first endwhen an end of the data being written does not reach the first end, andwherein the tape medium has a plurality of bands extending in alongitudinal direction of the tape medium, each of the bands having aplurality of wraps extending in the longitudinal direction, and whereinthe back-and-forth data writing is performed on pairs of the wraps.